<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/vue.js"></script>
    <title>Vue内置标签</title>
</head>
<body>
<div id="root">
    <h2>v-text</h2>
    <span>你好,{{name}}</span>
    <span v-text="name">你好,</span>
    <h2>v-html</h2>
    <div v-text="htmlStr"></div>
    <div v-html="htmlStr"></div>
    <h2>v-once</h2>
    <p v-once>初始值：{{sum}}</p>
    <p>当前值：{{sum}}</p>
    <p>使用filters（Vue3移除）：{{sum| funSum}}</p>
    <button @click="sum++">点击sum++</button>
    

</div>
 
<script>
    new Vue({
        el:'#root',
        data:{
            name:'admin',
            htmlStr:`<a href="http://www.baidu.com">点击送</a>`,
            sum:0
        },
        filters:{
            funSum(v){
                return v*v;
            }
        }
    })
</script>
</body>
</html>